package com.bravo.listeners;

import com.bravo.event.OrderSuccessEvent;

/**
 * @Auther: Min.Liu
 * @Description:
 * @Date: Created in 14:17 2024/6/11
 */
public class SmsService implements BravoApplicationListener<OrderSuccessEvent> {
    /**
     * 事件下单成功的监听回调方法
     * @param event
     */
    @Override
    public void onApplicationEvent(OrderSuccessEvent event) {
        // 调用方法，发送短信
        this.sendSms();
        //执行回调
        event.callback();
    }

    public void sendSms() {
        try {
            Thread.sleep(1000L * 3);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("发送短信成功...");
    }
}
